
/**
  ******************************************************************************
  * Copyright 2021 The Microbee Authors. All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * 
  * @file       uitc_battery_status.h
  * @author     baiyang
  * @date       2022-10-29
  ******************************************************************************
  */

#pragma once

#ifdef __cplusplus
extern "C"{
#endif

/*----------------------------------include-----------------------------------*/
#include <stdint.h>
#include <stdbool.h>

#include <uITC/uITC.h>
/*-----------------------------------macro------------------------------------*/
ITC_DECLARE(battery_status);
/*----------------------------------typedef-----------------------------------*/
typedef struct {
    uint64_t                    timestamp_us;
    float                       primary_voltage;                   // voltage in volts
    float                       primary_gcs_voltage;
    float                       primary_current_amps;              // current in amperes
    float                       primary_consumed_mah;              // total current draw in milliamp hours since start-up
    float                       primary_consumed_wh;               // total energy consumed in Wh since start-up
    int8_t                      primary_remaining_pct;
    uint8_t                     max_instances;
    uint8_t                     num_instances;
    uint8_t                     primary_instances;
    uint8_t                     cells_max;
    bool                        all_healthy;
    bool                        primary_healthy;
    bool                        has_failsafed;
    bool                        primary_has_current;
    bool                        primary_has_consumed_energy;
} uitc_battery_status;
/*----------------------------------variable----------------------------------*/

/*-------------------------------------os-------------------------------------*/

/*----------------------------------function----------------------------------*/

/*------------------------------------test------------------------------------*/

#ifdef __cplusplus
}
#endif



